package com.traveldream.entities;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the invite database table.
 * 
 */
@Embeddable
public class InvitePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="booked_packet_id", insertable=false, updatable=false)
	private int bookedPacketId;

	@Column(name="customer_booked_email", insertable=false, updatable=false)
	private String customerBookedEmail;

	public InvitePK() {
	}
	public int getBookedPacketId() {
		return this.bookedPacketId;
	}
	public void setBookedPacketId(int bookedPacketId) {
		this.bookedPacketId = bookedPacketId;
	}
	public String getCustomerBookedEmail() {
		return this.customerBookedEmail;
	}
	public void setCustomerBookedEmail(String customerBookedEmail) {
		this.customerBookedEmail = customerBookedEmail;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof InvitePK)) {
			return false;
		}
		InvitePK castOther = (InvitePK)other;
		return 
			(this.bookedPacketId == castOther.bookedPacketId)
			&& this.customerBookedEmail.equals(castOther.customerBookedEmail);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.bookedPacketId;
		hash = hash * prime + this.customerBookedEmail.hashCode();
		
		return hash;
	}
}